feat(core,desktop): M6-rest part 4 — typed IPC protocol + real handlers + renderer wiring#52
Merged
Merged
Conversation
…rs + renderer wiring
Defines the type-safe IPC contract between renderer ↔ main, wires the
listed handlers in electron/main.ts (still skipped by default until the
electron binary lands), and switches the 4 list-y screens (Sessions /
Plugins / MCP / Skills) to call the real IPC with a graceful empty-list
fallback when window.deepcode.* isn't present.
· packages/core/src/ipc/protocol.ts (NEW, ~160 lines)
- IpcRequestMap — exhaustive per-channel { req, res } typing for
app:version, creds:load/save, settings:load, sessions:list/resume,
plugins:list/install/setEnabled, mcp:list, skills:list/body,
agent:start/abort/approve/answer.
- IpcEventMap — one-way events (agent:event for streamed turns,
updater:update-downloaded).
- AgentStreamEvent — union of agent loop event (text_delta /
tool_use / tool_result / usage / turn_complete / error) +
approval_request + ask_user + turn_done — keyed by turnId so the
renderer can route multiple concurrent turns.
- newTurnId / newQuestionId helpers.
- 4 tests + re-export from core index.
· apps/desktop/electron/preload.ts — full typed surface exposed to
renderer via contextBridge. window.deepcode now has sessions, plugins,
mcp, skills, agent + onUpdateDownloaded.
· apps/desktop/src/types/global.d.ts — corresponding renderer-side
declarations for window.deepcode.
· apps/desktop/electron/main.ts — added handlers:
sessions:list, plugins:list, mcp:list, skills:list, skills:body.
(Agent loop handlers + install/setEnabled mutators land alongside
the live agent streaming wiring in a follow-up; the protocol is
pinned now so the renderer code is final.)
· apps/desktop/src/screens/{Sessions,Plugins,MCPManager,Skills}.tsx —
real IPC fetch with empty-list fallback for current pre-electron state.
Tests: core 445 → 449 (+4 ipc); total 508 → 512 passing. Build clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type-safe IpcRequestMap covering 14 channels; AgentStreamEvent union for streamed turns. Preload exposes the full surface; main wires 5 list handlers. 4 list screens now call real IPC with graceful fallback. 508→512 passing.